<%@ page import="java.io.File" %>
<%@ page import="com.bean.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="js/jquery.min.js"></script>
    <!-- Custom Theme files -->
    <!--menu-->
    <script src="js/scripts.js"></script>
    <link href="css/styles.css" rel="stylesheet">
    <!--//menu-->
    <!--theme-style-->
    <link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
    <!--//theme-style-->
    <link rel="shortcut icon" href="webicon.ico" type="image/x-icon" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="" />
    <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
</head>


<link rel="stylesheet" href="css/amazeui.css" />
<link rel="stylesheet" href="css/other.min.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑主页</title>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script>


<body>


<!--header-->
<div class="navigation">
    <div class="container-fluid">
        <nav class="pull">
            <ul>
                <li><a  href="index.jsp">主页</a></li>
                <li><a  href="travelList.jsp?page=1">驴友游记</a></li>
                <li><a  href="share.jsp">发布游记</a></li>
            </ul>
        </nav>
    </div>
</div>

<div class="header">
    <div class="container">


        <div class="top-nav">
            <ul class="right-icons">

                <!--根据是否登录显示-->
                <li>
                    <% if(session.getAttribute("user") == null){ %>
                    <a  href="login.jsp">
                        <i class="glyphicon glyphicon-user">
                        </i>Login</a></li>
                <% } else {
                    //获取用户名name
                    int ID = ((User)(session.getAttribute("user"))).getUsername();
                    String name = ((User)(session.getAttribute("user"))).getName();%>
                <a  onclick="window.location.href='UserServlet?method=admin&ID=<%=ID%>'">
                    <i class="glyphicon glyphicon-user">
                    </i><%=name%></a></li>
                <% }
                %>

            </ul>


            <div class="nav-icon">
                <div class="hero fa-navicon fa-2x nav_slide_button" id="hero">
                    <a href="#"><i class="glyphicon glyphicon-menu-hamburger"></i> </a>
                </div>
            </div>

            <link href="css/popuo-box.css" rel="stylesheet" type="text/css" media="all"/>
            <script src="js/jquery.magnific-popup.js" type="text/javascript"></script>


            <script src="js/easyResponsiveTabs.js" type="text/javascript"></script>
            <script type="text/javascript">
                $(document).ready(function () {
                    $('#horizontalTab').easyResponsiveTabs({
                        type: 'default', //Types: default, vertical, accordion
                        width: 'auto', //auto or any width like 600px
                        fit: true   // 100% fit in a container
                    });
                });
            </script>
        </div>
    </div>
    <script>
        $(document).ready(function() {
            $('.popup-with-zoom-anim').magnificPopup({
                type: 'inline',
                fixedContentPos: false,
                fixedBgPos: true,
                overflowY: 'auto',
                closeBtnInside: true,
                preloader: false,
                midClick: true,
                removalDelay: 300,
                mainClass: 'my-mfp-zoom-in'
            });

        });
    </script>
</div>

<div class="container">
    <div class="buy-single-single">

            <div class="buy-sin-single">
                <form method="post" action="UserServlet?method=adminEdit" class="am-form" data-am-validator>

                <div class="col-sm-5 middle-side immediate">


                    <!--获取用户个人信息customer表-->
                    <%
                        int ID = ((User)(session.getAttribute("userAdmin"))).getUsername();
                        String name = ((User)(session.getAttribute("userAdmin"))).getName();
                        int age = ((User)(session.getAttribute("userAdmin"))).getAge();
                        String sex = ((User)(session.getAttribute("userAdmin"))).getSex();
                        String email = ((User)(session.getAttribute("userAdmin"))).getEmail();
                        String introduction = ((User)(session.getAttribute("userAdmin"))).getIntroduction();

                    %>

                    <h4>用户资料：</h4>
                    

                        <input type="hidden" name="ID" value="<%=ID%>">
                    <p><span class="bath">Email</span><span class="two"><%=email%></span></p>
                        <input type="hidden" name="email" value="<%=email%>">
                    <p><span class="bath1">用户名 </span><input class="two" type="text" name="name" value="<%=name%>"/></p>
                    <p><span class="bath2">年龄</span><input class="two" type="number" name="age" value="<%=age%>"/></p>
                    <p><span class="bath3">性别 </span>
                    <%
                        if(sex.equals("女")){
                        	%>
                        	<input id="r1" type="radio" value="男" name="sex">男</input>
                        	&nbsp;&nbsp;&nbsp;&nbsp;
                            <input id="r2" type="radio" value="女" name="sex" checked="checked">女</input>
                    <%  	
                        }else{
                        	%>
                        	<input id="r1" type="radio" value="男" name="sex" checked="checked">男</input>
                        	&nbsp;&nbsp;&nbsp;&nbsp;
                            <input id="r2" type="radio" value="女" name="sex">女</input>
                    <%   	
                        }
                    %>
                  </p>

                </div>
                <div class="col-sm-7 buy-sin">
                    <h4>主页简介</h4>
                    <p><textarea id="introduction" name="introduction" class="form-control" rows="9" placeholder="<%=introduction%>" onfocus="if(value=='<%=introduction%>'){value=''}"
                                 onblur="if (value ==''){value='<%=introduction%>'}" required><%=introduction%></textarea></p>
                </div>
                <div class="right-side">
                        <button class="hvr-sweep-to-right more am-btn am-btn-secondary" type="submit" name="action">保存修改</button>
                    </div>
                </form>
            </div>

    </div>
</div>
</body>
</html>
